﻿using System;
using System.Reflection;

namespace BizControl.Library.AI.Attributes
{
  public class Property
  {
    private const string NullConverterString = @"Nothing";
    public AttributeType AttributeType { get; set; }
    public PropertyInfo PropertyInfo { get; set; }
    public MethodInfo ConvertMethod { get; set; }
    public Type Converter { get; set; }

    public override string ToString()
    {
      var converter = ConvertMethod == null ?
                      (Converter == null ? NullConverterString : Converter.FullName)
                      : ConvertMethod.ToString();
      return string.Format("{0} ({1}, Converted by {2})", PropertyInfo, AttributeType, converter);
    }
  }
}
